/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lucequestionhelper;

import java.awt.EventQueue;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Arrays;
import java.util.Vector;

/**
 *
 * @author nabraham
 */
public class LuceQuestionHelper {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                //List<String> list = new ArrayList<String>(Arrays.asList(
                //        "Austria", "Croatia", "Hungary", "Italy"));
                
                QuestionFrame qf = new QuestionFrame();
                qf.setResizable(false);
//                Vector<String> newQs = new Vector<String>(Arrays.asList(
//                        "where is desmond?", "where is mary?", "where is nathan"));
                
                
                qf.getQuestionPanel().setList(loadFile("data/allQuestions.txt"));
                qf.getQuestionPanel().setUsers(loadFile("data/users.txt"));

                qf.setVisible(true);
            }
        });
    }
    
    
    public static Vector<String> loadFile(String filename) {
        Vector<String> rez = new Vector<String>();
        
        try {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            String line;
            while ((line = in.readLine()) != null) {
                rez.add(line);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        return rez;
    }
}
